package com.xc.hotelmgr.webapi.modules.ht.service.impl;

import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xc.hotelmgr.webapi.common.utils.PageUtils;
import com.xc.hotelmgr.webapi.common.utils.Query;

import com.xc.hotelmgr.webapi.modules.ht.dao.HtTypeDao;
import com.xc.hotelmgr.webapi.modules.ht.entity.HtTypeEntity;
import com.xc.hotelmgr.webapi.modules.ht.service.HtTypeService;


@Service("htTypeService")
public class HtTypeServiceImpl extends ServiceImpl<HtTypeDao, HtTypeEntity> implements HtTypeService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Object typeName = params.get("typeName");
        IPage<HtTypeEntity> page = this.page(
                new Query<HtTypeEntity>().getPage(params),
                new QueryWrapper<HtTypeEntity>().like(typeName != null,"type_name",typeName)
        );

        return new PageUtils(page);
    }

}